#ifndef GAMEVIEW_H
#define GAMEVIEW_H

#include <OgreCamera.h>
#include <OgreRenderWindow.h>
#include <OgreViewport.h>
#include <OgreSceneManager.h>
#include <iterator>
#include <vector>
#include <map>
#include <string>
#include <boost/function.hpp>
#include <OgreOverlayManager.h>
#include <OgreOverlayContainer.h>
#include <OgreOverlayElement.h>
#include <OgreTextAreaOverlayElement.h>
#include <cstdio>
#include <cstdlib>


#include "ComputerPlayerActor.h"
#include "HumanPlayerActor.h"
#include "ActorType.h"
#include "DebugTracer.h"


enum KeyAction
{
    K_ACCELERATE = 0,
    K_TURNLEFT = 1,
    K_TURNRIGHT = 2,
    K_BRAKE = 3
};
class Game;
class Race;
class TrackActor;
class Actor;
class GameView
{
    public:
        GameView(Ogre::RenderWindow *window,Ogre::SceneManager* scene,Game *game);
        virtual ~GameView();
        void SetActor(Actor *actor);
        void Update(float timedelta);
        inline Ogre::Camera* GetActiveCamera()
        {
            return m_currentCamera;
        }
    protected:
    private:
        Actor               *m_mainActor;
        Ogre::RenderWindow  *m_window;
        Ogre::Camera        *m_currentCamera;
        Ogre::Viewport      *m_viewport;

        std::vector<Actor*> m_actorList;
        Game*               m_game;

        Ogre::OverlayContainer* m_debugContainer;
        Ogre::TextAreaOverlayElement* m_debugOverlayPos;
        Ogre::TextAreaOverlayElement* m_debugOverlayVel;
        Ogre::Overlay* m_debugOverlay;



};

#endif // GAMEVIEW_H
